<template>
	<view class="payinfo-wp">
		<view class="flex_between_center card">
			<view class="img-box">
				<view class="title">
					支付宝收款码
				</view>
				<view class="img-wp">
					<image style="width: 184rpx;height:184rpx;" :src="payInfo.aliPay" mode="" v-if="payInfo.aliPay">
					</image>
					<view class="noimg" v-else>
						暂未设置
					</view>
				</view>

			</view>
			<view class="img-box">
				<view class="title">
					微信收款码
				</view>
				<view class="img-wp">
					<image style="width: 184rpx;height:184rpx;" :src="payInfo.weChat" mode="" v-if="payInfo.weChat">
					</image>
					<view class="noimg" v-else>
						暂未设置
					</view>
				</view>

			</view>
		</view>
		<view class="other card">
			<view class="title">
				其他收款方式
			</view>
			<view class="rich-text">
				<textarea disabled v-model='payInfo.rests' v-if="payInfo.rests"
					style="background:#fff;width: 100%;height: 180rpx;" />
				<view class="no-title" v-else>
					暂无信息
				</view>
			</view>
		</view>
		<view class="option-btn-wp">
			<view class="option-btn" @click.stop="goToEdit()">
				编辑
			</view>

		</view>
	</view>
</template>

<script>
	export default {

		props: ['payInfo', 'hasPayInfo'],
		created() {

		},
		methods: {

			goToEdit() {
				if (this.hasPayInfo) {
					uni.navigateTo({
						url: '/pagesMall/myShop/editPayInfo'
					})
				} else {
					uni.navigateTo({
						url: '/pagesMall/myShop/addPayInfo?addPayInfo=1'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.payinfo-wp {
		margin: 24rpx 32rpx;
		padding: 24rpx;
		border-radius: 16rpx;
		background-color: #fff;


		.card {
			border-radius: 16rpx;
			border: 2rpx solid #F2F3F5;
		}

		.img-box {
			margin: 0 auto;
			width: 304rpx;
			height: 304rpx;


			.title {
				margin-top: 30rpx;
				text-align: center;
				height: 40rpx;
				font-size: 28rpx;
				font-weight: 600;
				color: #1D2129;
				line-height: 39rpx;
			}

			.img-wp {
				background-color: #f7f8fa;
				width: 184rpx;
				height: 184rpx;
				border: 1rpx dotted #8d8e8f;
				margin: 22rpx auto;
			}

			.noimg {
				font-size: 24rpx;
				text-align: center;
				color: #86909C;
				line-height: 184rpx;
				width: 184rpx;
				height: 184rpx;
				background-color: #f7f8fa;
			}
		}

		.other {
			background-color: #fff;
			margin-top: 24rpx;
			padding: 32rpx;
			border-radius: 16rpx;

			.title {
				font-weight: 600;
				height: 40rpx;
				font-size: 28rpx;
				color: #1D2129;
				line-height: 39rpx;
			}

			.no-title {
				margin-top: 20rpx;
				height: 34rpx;
				font-size: 24rpx;
				font-weight: 400;
				color: #86909C;
				line-height: 34rpx;
			}
		}



		.option-btn-wp {
			margin-top: 24rpx;
			display: flex;
			justify-content: flex-end;


			.option-btn {
				text-align: center;
				width: 112rpx;
				height: 48rpx;
				border-radius: 200rpx;
				border: 2rpx solid #86909C;
				font-size: 24rpx;
				color: #86909C;
				line-height: 48rpx;
				margin-left: 20rpx;

			}


		}

	}
</style>